import request from '@/utils/request.js'

export const allCategory = () => {
  return request({
    url: '/home/category/head',
    method: 'get'
  })
}
// 一级分类
export const findTopCategory = (submitData) => {
  return request({
    url: '/category',
    method: 'get',
    submitData
  })
}

// 二级分类
export const findSubCategory = (submitData) => {
  return request({
    url: '/category/sub',
    method: 'get',
    submitData
  })
}

// 二级分类 - 筛选列表
export const findSubFilter = (submitData) => {
  return request({
    url: '/category/sub/filter',
    method: 'get',
    submitData
  })
}
/**
 * 二级分类 - 商品列表--分页查询
 * @param {  }
 * @returns Promise
 */
export const findCategoryGoods = (submitData) => {
  return request({
    // url: '/category/goods',
    url: '/category/goods/temporary',
    method: 'POST',
    submitData
  })
}